/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package db;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author devashish
 */
@Entity
@Table(name = "labeltypes")
@NamedQueries({
    @NamedQuery(name = "Labeltypes.findAll", query = "SELECT l FROM Labeltypes l"),
    @NamedQuery(name = "Labeltypes.findByLabelTypeId", query = "SELECT l FROM Labeltypes l WHERE l.labelTypeId = :labelTypeId"),
    @NamedQuery(name = "Labeltypes.findByLabelType", query = "SELECT l FROM Labeltypes l WHERE l.labelType = :labelType")})
public class Labeltypes implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "LabelTypeId")
    private Short labelTypeId;
    @Basic(optional = false)
    @Column(name = "LabelType")
    private String labelType;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "labelTypeId")
    private Collection<Label> labelCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "labelTypeId1")
    private Collection<Label> labelCollection1;

    public Labeltypes() {
    }

    public Labeltypes(Short labelTypeId) {
        this.labelTypeId = labelTypeId;
    }

    public Labeltypes(Short labelTypeId, String labelType) {
        this.labelTypeId = labelTypeId;
        this.labelType = labelType;
    }

    public Short getLabelTypeId() {
        return labelTypeId;
    }

    public void setLabelTypeId(Short labelTypeId) {
        this.labelTypeId = labelTypeId;
    }

    public String getLabelType() {
        return labelType;
    }

    public void setLabelType(String labelType) {
        this.labelType = labelType;
    }

    public Collection<Label> getLabelCollection() {
        return labelCollection;
    }

    public void setLabelCollection(Collection<Label> labelCollection) {
        this.labelCollection = labelCollection;
    }

    public Collection<Label> getLabelCollection1() {
        return labelCollection1;
    }

    public void setLabelCollection1(Collection<Label> labelCollection1) {
        this.labelCollection1 = labelCollection1;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (labelTypeId != null ? labelTypeId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Labeltypes)) {
            return false;
        }
        Labeltypes other = (Labeltypes) object;
        if ((this.labelTypeId == null && other.labelTypeId != null) || (this.labelTypeId != null && !this.labelTypeId.equals(other.labelTypeId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "db.Labeltypes[labelTypeId=" + labelTypeId + "]";
    }

}
